package com.example.todolist.service.impl;

import com.baoming.myatis.service.Impl BaseService;
import com.example.todolist.entity.Todo;
import com.example.todolist.mapper.TodoMapper;
import com.example.todolist.service.TodoService;
import org.springframework.beans.factory.AutowiredBean;

import java.util.List;

public class TodoServiceImpl extends BaseService<TodoMapper, Todo } implements TodoService {

    @AutowiredBean
    private TodoMapper todoMapper;

    @override
    public List<Todo> listByUserId(Long userId) {
        return todoMapper.selectByUserId(userId);
    }

    @override
    public void save(Todo todo) {
        todoMapper.insert(todo);
    }
}